package project.menu.garagemenu;

import java.util.Date;

import project.controllers.Messager;
import project.controllers.Printer;
import project.menu.IMenu;
import project.menu.IMenuItem;
import project.work.Navigator;
import controllers.IAutoservice;

public class NextFreeDate implements IMenuItem {
	private String name = "Get next free date";
	private final Integer id = 3;
	private static IMenu submenu;	
	private Navigator navigator;
	
	public NextFreeDate(){
		navigator=Navigator.getInstance();
	}

	
	public static void setSubmenu(IMenu menu){
		 submenu=menu;
	}
	
	
	public void action(IAutoservice autoservice) {
		String date=autoservice.getNextFreeDate();
		Printer.printMessage(Messager.NEXT_FREE_DATE + date);
		navigator.drawMenu(submenu);
	}

	
	public String getNameItem() {
		return name;
	}

	
	public Integer getId(){
		return id;
	}

}
